﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OAuth2.Framework
{
    public static class Parameters
    {
        public const string AuthroizationCode = "code";

        public const string ResponseType = "response_type";

        public const string State = "state";

        public const string IsApproved = "isapproved";

        public const string ClientId = "client_id";

        public const string ClientSecret = "client_secret";

        public const string RedirectUri = "redirect_uri";

        public const string Scope = "scope";

        public const string RefreshToken = "refreshToken";

        public const string GrantType = "grant_type";

        public const string AccessToken = "access_token";

        public const string AccessTokenType = "token_type";

        public const string AccessTokenExpiresIn = "expires_in";

        public const string ResourceOwnerUsername = "username";

        public const string ResourceOwnerPassword="password"

        /// <summary>
        /// 错误信息
        /// </summary>
        public static class ErrorParameters
        {
            public const string Error = "error";
            public const string ErrorDescription = "error_description";
            public const string ErrorUri = "error_uri";

            public static class ErrorValues
            {
                /// <summary>
                /// The request is missing a required parameter, includes an
                /// unsupported parameter or parameter value, or is otherwise
                /// malformed.
                /// </summary>
                public const string InvalidRequest = "invalid_request";

                /// <summary>
                /// The client is not authorized to request an authorization code
                /// using this method.
                /// </summary>
                public const string UnauthorizedClient = "unauthorized_client";

                /// <summary>
                /// The resource owner or authorization server denied the request.
                /// </summary>
                public const string AccessDenied = "access_denied";

                /// <summary>
                /// The authorization server does not support obtaining an
                /// authorization code using this method.
                /// </summary>
                public const string UnsupportedResponseType = "unsupported_response_type";

                /// <summary>
                /// The requested scope is invalid, unknown, or malformed.
                /// </summary>
                public const string InvalidScope = "invalid_scope";
            }
        }

        public static class GrantTypeValues {
            public const string AuthorizationCode = "authorization_code";
            public const string Password = "password";
            public const string ClientCredentials = "client_credentials";
            public const string ResfreshToken = "resfresh_token";
        }
    }
}
